You are here: Trading System Programming > Reference > Classes > Order > Order Methods > getOrderId

getOrderId

The getOrderId method returns order's orderId. OrderId is used internally by the trading broker and has no meaning inside ActiveTick other than order identification.

Syntax

var getOrderId();

Return Value

This method order's id as a string value.

Example

The following example demonstrates the use of getOrderId() method.

 

function start()

{

//retrieve account's open orders

var account = getAccount();

var openOrders = account.getOrders();

 

//loop through all orders

for(var i = 0; i < openOrders.length, i++)

{

var order = openOrders[i];

 

if(order.getOrderType() == ORDERTYPE_LIMIT)

{

var orderId = order.getOrderId();

}

}

 

//proceed further...

}

 


Copyright © 2006-2009 ActiveTick LLC